<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
    <style>
        body{
            background-image:url("030370af20876c70e66f6c4bdd26cb42.jpeg") ;
            background-repeat: no-repeat;
            background-size: cover;
        }
        h1{
            font-size: 100px;
        }

    </style>
</head>
<body>
<div id="app">
<h1 align="center" style="color: white">权限管理系统</h1>
    <el-card style="width: 600px;height: 300px;margin: 70px auto;
                background-color: rgba(255,255,255,0.3)">
        <!--label-width设置用户名这一列所占的宽度,如果不设置会显示在上面-->
        <el-form v-if="f==1" label-width="60px" style="width: 400px;margin: 50px auto">
            <el-form-item label="用户名">
                <el-input type="text" v-model="user.username" placeholder="请输入用户名"></el-input>
            </el-form-item>
            <el-form-item label="密码">
                <el-input type="password" v-model="user.password" placeholder="请输入密码"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button style="position: relative;right:-60px"
                           type="primary">登录</el-button>
                <el-button style="position: relative;right:-80px"
                           type="primary" @click="f1()">注册</el-button>
            </el-form-item>
            </el-form-item>
        </el-form>

        <el-form v-else label-width="60px" style="width: 400px;margin: 50px auto">
            <h4 style="margin-top: 0px; margin-bottom: 10px;">欢迎新用户</h4>
            <el-form-item label="用户名">
                <el-input type="text" v-model="user.username" placeholder="请输入用户名"></el-input>
            </el-form-item>
            <el-form-item label="密码">
                <el-input type="password" v-model="user.password" placeholder="请输入密码"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button style="position: relative;right:-100px"
                           type="primary">注册</el-button>
            </el-form-item>
        </el-form>

    </el-card>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
   let v = new Vue({
        el: '#app',
        data: function() {
            return {
                user:{username:"",password:""},
                f:'1',
            }
        },
       methods:{
           f1(){
               v.f='2';
           }
       }
    })
</script>
</html>